Skip to content

Conversation

@OStevan
Copy link
Contributor

@OStevan OStevan commented Sep 27, 2021

Before this PR

In this draft tracing-java propagates an additional header across requests which will contain the user agent which was originally used to send a request.

Questions:

  1. Should users of the library be able to set it when opening a span (essentially setting this info through the tracing lib)?
  2. Should conjure clients set this header when sending a request?

Tests are missing

@OStevan OStevan added enhancement New feature or request help wanted Extra attention is needed do not merge no changelog labels Sep 27, 2021
@OStevan OStevan requested a review from carterkozak September 27, 2021 14:03
Copy link
Contributor

@carterkozak carterkozak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a quick scan over this (not terribly thorough). Before implementing this I think we should factor out common tracing state (information which applies to a trace, not individual spans) into a single object that's shared between Trace and DetachedSpan (e.g. traceId and requestId). That way features like this one don't require so much plumbing.

@Deprecated
String ORIGINATING_SPAN_ID = "X-OrigSpanId";

String FOR_USER_AGENT = "X-For-User-Agent";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: X- prefixes were deprecated several years ago in RFC 6648

Comment on lines +51 to +54
/**
* The Key under which origin user agents are inserted into SLF4J {@link org.slf4j.MDC MDCs}.
*/
public static final String FOR_USER_AGENT_KEY = "__forUserAgent";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this belongs in the MDC, we can find it based on the requestId

@OStevan
Copy link
Contributor Author

OStevan commented Oct 22, 2021

Closing in favor of #790

@OStevan OStevan closed this Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge enhancement New feature or request help wanted Extra attention is needed no changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants